package com.cn.wanxi.util.utils;

import com.cn.wanxi.util.model.SchoolCurriculumModel;
import com.cn.wanxi.util.model.SchoolTitleModel;

import java.util.ArrayList;
import java.util.List;

public class SchoolTitleUtile {
    FileUtile fileUtile=new FileUtile();
    public List<SchoolTitleModel> readSchoolTitleModel(){
        List<SchoolTitleModel> schoolTitleModelList =new ArrayList<>();
        String title =fileUtile.readFileToString("SchoolTitleFile.txt");
        String[] titles = title.split(";");
        for (int i=0;i<titles.length;i++){
            String item = titles[i];
            String[] info = item.split(",");
            SchoolTitleModel schoolTitleModel =new SchoolTitleModel(info[0].trim(),info[1].trim(),info[2].trim(),info[3].trim());
            schoolTitleModelList.add(schoolTitleModel);
        }
        return schoolTitleModelList;
    }
}
